<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>預借資料</title>
</head>
<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/>
<% 
	  String sql="select BOOK_REASON from BOOK WHERE BOOK_ID='"+request.getParameter("bn")+"'";
	  ResultSet rs=mydb.executeQuery(sql);
	  rs.next();
	  
%>
	  <table width="350" border="0" align="center">
  		<tr>
    		<td bgcolor="#333399" font-weight="bold">預借理由</td>
  		</tr>
  		<tr>
    		<td ><%=rs.getString("BOOK_REASON")%></td>
  		</tr>
	</table>
    
   <%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
 
</body>
</html>